package cn.com.xxlibrary.dao.impl;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import cn.com.xxlibrary.dao.IIndexDao;

@Transactional
@Repository("indexDao")
public class IndexDaoImpl implements IIndexDao {
	
	@Autowired
	@Qualifier("sessionFactory")
	SessionFactory sessionFactory;

	@Override
	public List queryMenus(int as) {
		Session session = sessionFactory.getCurrentSession();
		String hql = "FROM MenuBean WHERE authSort>="+as;
		return session.createQuery(hql).list();
	}

}
